#include"ConCurrent.hpp"
void alloc()
{
	std::vector<void*> vec;
	for (int i = 1;i < 8*1024;++i)
	{
		vec.emplace_back(ConCurrentAlloc(i));
		//std::cout << "id:" << std::this_thread::get_id() << "|ptr:" << vec.back().first << std::endl;
	}
	for (auto& e : vec)
		ConCurrentFree(e);
}
void test()
{
	std::thread t1(alloc);
	std::thread t2(alloc);
	std::thread t3(alloc);
	t1.join();
	t2.join();
	t3.join();
}

void bigAlloc()
{
	void* ptr1 = ConCurrentAlloc(257*1024);
	ConCurrentFree(ptr1);

	void* ptr2 = ConCurrentAlloc(129 * 8 * 1024);
	ConCurrentFree(ptr2);
}

//int main()
//{
//	test();
//}